#!/usr/bin/env python3


"""
Hus
"""

#CONFIG AREA
PLUGINS_DIR="scripts"
MODULES_DIR="modules"
#CONFIG AREA

import os
import sys
sys.path.append([PLUGINS_DIR,MODULES_DIR])


def log(item):
    print("[HUS] %s " % item )


def load_scripts(*script_name):
    scripts = []
    if not script_name:
        for script_file in os.listdir(PLUGINS_DIR):
            if script_file != "__pycache__":
                scripts.append( script_file.replace(".py","") )
        scripts.sort()
        log( "Load %s plugins" % len(scripts) )
    else:
        for script in script_name:
            scripts.append(script)
    return scripts


if __name__ == "__main__":
    scripts = load_scripts()

    for script in scripts:
        s = __import__( script )
        scan=s.Scan()
        info = scan.info
        result = scan.run( "http://www.baidu.com" )
        if result:
            #print(info)
            print(result)
